<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <body>
        <h:form id ="dataForm">
            <h:panelGrid  styleClass="body_content_box" columns="1">
                <h:panelGrid styleClass="table_border" columns="1" cellpadding="0" cellspacing="0">
                    <h:panelGrid styleClass="table_title" columns="1" cellpadding="0"
                                 cellspacing="2">
                        <h:outputLabel value="#{listBean.tableTitle}"  style="vertical-align: middle"/>
                    </h:panelGrid>
                    <t:dataTable id="dataTable" value="#{listBean.data}"
                                 var="row" rows="#{listBean.pageInfo.pageSize}"
                                 headerClass="table_header"
                                 styleClass="mxl"
                                 rowClasses="list-row1-background,list-row2-background"
                                 >
                        <t:column style="width:2%" rendered="#{listBean.multiSelectable}">
                            <f:facet name="header">
                                <h:selectBooleanCheckbox id="multiSelected"
                                                         value="#{listBean.allSelected}"
                                                         rendered="#{listBean.multiSelectable}"
                                                         onclick="SetCheckedStatus()">
                                </h:selectBooleanCheckbox>
                            </f:facet>
                            <h:selectBooleanCheckbox value="#{listBean.selected}"
                                                     rendered="#{listBean.multiSelectable}"
                                                     onchange="submit()"
                                                     onclick="CheckAll()">
                            </h:selectBooleanCheckbox>
                        </t:column>
                        <t:columns value="#{listBean.headerColumns}" var="headerRow" width="#{headerRow.width}">
                            <f:facet name="header">
                                <h:outputText value="#{headerRow.columnText}" />
                            </f:facet>
                            <h:outputText value="#{listBean.columnValue}"/>
                        </t:columns>
                        <t:column width="5%" rendered="#{listBean.editable &amp;&amp; !userLoginBean.normal}">
                            <f:facet name="header">
                                <h:outputText/>
                            </f:facet>
                            <h:commandLink action="#{listBean.editData}" value="#{msg.lnk_edit}"/>
                        </t:column>
                        <t:column width="5%" rendered="#{listBean.deletable &amp;&amp; !userLoginBean.normal}">
                            <f:facet name="header">
                                <h:outputText/>
                            </f:facet>
                            <h:commandLink  onclick="if (!confirm('#{msg.confirm_to_delete}')) return false"  action="#{listBean.deleteData}" value="#{msg.lnk_delete}"/>
                        </t:column>
                        <t:column width="5%" rendered="#{listBean.viewable}">
                            <f:facet name="header">
                                <h:outputText/>
                            </f:facet>
                            <h:commandLink action="#{listBean.showDetail}" value="#{msg.lnk_view}"/>
                        </t:column>
                    </t:dataTable>
                    <h:panelGrid columns="2" cellpadding="0" cellspacing="0">
                        <t:dataScroller id="scroll" for="dataTable" rowsCountVar="#{listBean.pageInfo.totalCount}"
                                        displayedRowsCountVar="#{listBean.pageInfo.displayCount}"
                                        pageCountVar="#{listBean.pageInfo.totalPages}"
                                        pageIndexVar="#{listBean.pageInfo.currentPage}"
                                        rendered="#{listBean.pagable}"
                                        actionListener="#{listBean.scrollAction}">
                            <f:facet name="first" >
                                <h:outputText value="第一页"/>
                            </f:facet>
                            <f:facet name="last">
                                <h:outputText value="最后页"/>
                            </f:facet>
                            <f:facet name="previous">
                                <h:outputText value="上一页"/>
                            </f:facet>
                            <f:facet name="next">
                                <h:outputText value="下一页"/>
                            </f:facet>
                        </t:dataScroller>
                        <h:outputFormat value="总记录数({0}), 第({1})页/共({2})页" styleClass="standard" >
                            <f:param value="#{listBean.pageInfo.totalCount}" />
                            <f:param value="#{listBean.pageInfo.currentPage}" />
                            <f:param value="#{listBean.pageInfo.totalPages}" />
                        </h:outputFormat>
                    </h:panelGrid>
                </h:panelGrid>
            </h:panelGrid>
        </h:form>
    </body>
</html>